package LimitedTimeGame.Day_0328.night;

import java.util.Scanner;

/**
 * @author zxc
 * @date 2023/03/28 19:52
 **/
public class LimitedSum {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 所要构造字符串中所包含的回文子串数量
        int n = scanner.nextInt();
        String result = "";
        char[] arr = new char[]{'r' , 'e' , 'd'};
        int[] temp = new int[45010];
        temp[0] = 0;
        for(int i = 1 ; i < 45000 ; i++){
            temp[i] = temp[i - 1] + i;
        }
        for(int i = 0 ; n > 0 ; i++){
            char ch = arr[i % 3];
            // 二分查找到temp数组中小于n的最大值
            int k = twoSearch(temp , n);
            System.out.println(k);
            for(int j = 0 ; j < k ; j++){
                result += ch;
            }
            n = n - temp[k];
        }
        System.out.println(result);
    }

    private static int twoSearch(int[] temp, int n) {
        int left = 0;
        int right = 45000;
        while(left + 1 < right){
            int mid = (left + right) / 2;
            System.out.println("left" + left + ",right" + right);
            if(temp[mid] <= n){
                left = mid;
            }
            else {
                right = mid - 1;
            }
        }
        return left;
    }
}
